Skip to content

Add clean-history-on-start and total-size-cap rolling policy properties for Log4J2 - #51153

Open
elephant-y wants to merge 2 commits into
spring-projects:mainfrom
elephant-y:gh-46468-log4j2-rolling-policy
Open

Add clean-history-on-start and total-size-cap rolling policy properties for Log4J2#51153
elephant-y wants to merge 2 commits into
spring-projects:mainfrom
elephant-y:gh-46468-log4j2-rolling-policy

Conversation

@elephant-y

Copy link
Copy Markdown

No description provided.

…es for Log4j2

Add CLEAN_HISTORY_ON_START and TOTAL_SIZE_CAP to Log4j2's
RollingPolicySystemProperty enum so that log4j2 users can configure
these rolling policy settings via application properties, matching the
existing support in logback's RollingPolicySystemProperty.

See spring-projectsgh-46468

Signed-off-by: yangzhice <a13644015167@qq.com>
@elephant-y
elephant-y force-pushed the gh-46468-log4j2-rolling-policy branch from 7e1fd78 to 688f494 Compare July 29, 2026 14:34
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 29, 2026
@snicoll snicoll changed the title Gh 46468 log4j2 rolling policy Add rolling policy properties for log4j2 configuration Jul 29, 2026
@snicoll

snicoll commented Jul 29, 2026

Copy link
Copy Markdown
Member

Thanks for the PR but those should be tested if possible. Look at Log4J2LoggingSystemTests and add the missing tests.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Jul 29, 2026
@snicoll snicoll changed the title Add rolling policy properties for log4j2 configuration Add clean-history-on-start and total-size-cap rolling policy properties for Log4J2 Jul 29, 2026
@elephant-y

elephant-y commented Jul 30, 2026

Copy link
Copy Markdown
Author

Thanks for the PR but those should be tested if possible. Look at Log4J2LoggingSystemTests and add the missing tests.

Thanks for the review! I've added assertions for both CLEAN_HISTORY_ON_START and TOTAL_SIZE_CAP to the rollingPolicySystemPropertiesAreApplied test in Log4J2LoggingSystemTests. I also aligned CLEAN_HISTORY_ON_START to use String type (matching logback's approach) since the system property value is resolved as a string. Let me know if there's anything else to address.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants